TransSkel Pascal 2.5 is my modernized version of TransSkel Pascal 2.0, which is Owen Hartnett's Pascal translation of Paul Dubois' TransSkel package. TransSkel Pascal 2.5 is in the public domain (just like the versions it is based upon).
I keep using this version for the simple reason that it is small, few files, and I can access the source from within Think Pascal (or MetroWerks Pascal for that matter - all demos have CodeWarrior project files as well as Think Pascal ones). TransSkel Pascal 2.0 is severely out of date by now, so it is about time for some updates.
I have tried to keep changes, especially interface changes, to a minimum. If you have an old program using TransSkel Pascal 2.0, plugging in TransSkel Pascal 2.5 is easy. Most changes are added calls, in order to support hierarchical menus, MultiFinder events (suspend/resume events) etc.
This file documents the changes and additions. The original documentation files are unchanged.
• function SkelHMenu (theMenu: MenuHandle; pSelect: ProcPtr; pClobber: ProcPtr): Boolean; {Added by Ingemar 22/8 -93}
SkelHMenu works like SkelMenu, but for a hierarcical menu.
• function SkelDialog (theDialog: DialogPtr; pEvent, pClose, pClobber, pFilter: ProcPtr): Boolean; {pFilter added by Ingemar 18/9-93}
SkelDialog now takes a "pFilter" parameter. It should be used for processing update events (which are not passed to the pEvent function since DialogSelect believes it can handle it for us - which it can't if we have special items), and for filtering away events. The filder function should be declated like this:
procedure Filter (theDialog: DialogPtr; var theEvent: EventRecord; var result: Boolean);
The dialog and the event are provided, plus a result parameter. If result is false when the filter function exits, then the event should be processed as usual. If you set it to true, then TransSkel discard the event, considering it processed. That way, you can filter out events, like certain keyclicks.
{Two new procedures for WNE-support, added by Ingemar 12/11-93}
These two just set parameters for the WaitNextEvent call. Note that you are responsible for disposing the mouse region when you are done with it.
{Utility function, added by Ingemar 13/7-94}
• function FindWindowByRefcon (theRefCon: Longint): WindowPtr;
Multi-window programs should have a way to find a certain window, for example to respond to a selection in a window menu or whatever. I needed it for some program of mine, so I added it.
{Suspend/resume, added by Ingemar 23/7 -94}
• procedure SkelSetSuspendResume (p: ProcPtr);
• function SkelGetSuspendResume: ProcPtr;
You set or get the suspend/resume event handler. It should be declared like this:
procedure DoSuspendResume (isResume: Boolean);
The parameter isResume tells if the application is resumed or suspended.
• procedure SkelSetMouseMoved (p: ProcPtr);
• function SkelGetMouseMoved: ProcPtr;
You set or get the suspend/resume event handler. It should be a procedure with no parameters.
There are also a few internal changes. TransSkel switches between GetNextEvent and WaitNextEvent automatically, and uses WaitNextEvent if possible (which it usually is). It calls AEProcessAppleEvent for you. A few bugs were fixed, including one that caused EventLog not to work.
TWO NEW DEMOS have been added:
- NewStuff: This is a demo that demonstrates most of the news in TransSkel 2.5. It has a hierarcical menu, a dialog with a default button (requires filtering of return/enter) and a user item (requires a custom update routine, which must be in the filter function), and works in the background with a higher sleep value. The cursor changes using mouse moved events.
- OlaSkel: OlaSkel is something between MiniSkel and Skel, but more useful than both. It is intended as a minimal foundation to build your TransSkel-using application on, good for quick hacks!
LEFT TO FIX:
There are a few things that I havn't fixed:
- TransEdit and TransDisplay should use mouse moved events.
- Apple Events could have more attention.
- Some old demos could be modernized, improved or removed.
- TransEdit should use styled TextEdit - or even better, WASTE.